import {
  Properties,
  CommonProps,
  CommonState,
  IOption,
} from '../common/SelectProps';
import { IGaeaSetting } from '../../defines/application';

export class Props extends CommonProps {
  public editSetting: IGaeaSetting = {
    key: 'gaea-radio-select',
    name: 'RadioSelect',
    type: 'text',
    grouping: 'optionType',
    editors: [...Properties],
  };
  public isDeclare?: boolean = false;
  public enableSearch = false;
  public customOption?: boolean = false;
  public resetOption?: boolean = false;
  public rules?: Array<any> = [];
  public hideSearchInput?: boolean = false;
}

export class State extends CommonState {
  selectedValue?: { label: string; text: string; value: string } | null;
  isModal = false;
  showModal?: boolean = false;
  checkedValue?: string;
  checkedLabel?: string | number;
  searchValue: any;
  customValue?: any;
  customOptionItem?: any;
  isSetCustomItem?: boolean; // 判断用户是否已经设置了自定义选项
  options: any[];
  sourceOptions: any[];
  loading?: boolean;
  noData?: boolean;
  otherParams?: any;
}
